/**
 * admui-basic v2.1.0 (http://www.admui.com/)
 * Copyright 2015-2019 Admui Team
 * Licensed under the Admui License 1.1 (http://www.admui.com/about/license)
 */
(function(window, document, $) {
  'use strict';

  window.App.extend({
    run: function() {
      var t = $('#dataTableExample').DataTable(
        $.concatCpt('dataTable', {
          columnDefs: [
            {
              searchable: false,
              orderable: false,
              targets: 0
            }
          ],
          order: [[1, 'asc']]
        })
      );
      t.on('order.dt search.dt', function() {
        t.column(0, {
          search: 'applied',
          order: 'applied'
        })
          .nodes()
          .each(function(cell, i) {
            var opt = cell;
            opt.innerHTML = i + 1;
          });
      }).draw();
    }
  });

  window.App.run();
})(window, document, jQuery);
